package ${package};

import ${packageBase}.core.vo.VOBean;
import ${packageBase}.core.jooq.tables.pojos.${className};

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Max;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

<#list dataTypes as dataType>import ${dataType};</#list>

/**
 * ${tableComment} VO模型
 *
 * @author motorfu
 * @email ffu@maxleap.com
 * @since ${date}
 */
@Data
public class ${className}VO extends VOBean {

<#list columnList as column>
<#if column.column_name != 'id' && column.column_name != 'parentId'>
  <#if column.column_className == 'String'>
  @NotEmpty(message = "${column.column_name}不能为空")
  @Length(max = ${column.column_length}, message = "${column.column_comment}内容超出长度")
  </#if>
  <#if column.column_className == 'Boolean'||column.column_className == 'Date'||column.column_className == 'Integer'||column.column_className == 'Long'>
  @NotNull(message = "${column.column_comment}不能为空")
  </#if>
  <#if column.column_className == 'Long'>
  @Max(value = Long.MAX_VALUE, message = "${column.column_comment}内容超出范围")
  </#if>
  <#if column.column_className == 'Integer'>
  @Max(value = Integer.MAX_VALUE, message = "${column.column_comment}内容超出范围")
  </#if>
</#if>
  @ApiModelProperty(notes = "${column.column_comment}")
  private ${column.column_className} ${column.column_name};
</#list>

  public ${className} toEntity() {
    ${className} entity = new ${className}();
  <#list columnList as column>
    entity.set${column.column_name3}(this.${column.column_name});
  </#list>
    return entity;
  }
}